package com.jm.springboot21.mapper;

import com.jm.springboot21.pojo.Dept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {
    List<Dept> findAll();
//    根据部门名字查询部门
    Dept findByName(String name);

    void add(Dept dept);
    void deleteById(int id);
    void updateById(Dept dept);
    //分页查询
    @Select("SELECT id, name, create_time as createTime, update_time as updateTime FROM dept")
    List<Dept> selectAllDepts();
    @Select("select count(*) from dept")
    Integer count();
}
